3.1279 \(\int \tan ^{-1}(x) \log (1+x^2) \, dx\)

Optimal. Leaf size=38 \[ -\frac{1}{4} \log ^2\left (x^2+1\right )+\log \left (x^2+1\right )+x \log \left (x^2+1\right ) \tan ^{-1}(x)+\tan ^{-1}(x)^2-2 x \tan ^{-1}(x) \]

[Out]

-2*x*ArcTan[x] + ArcTan[x]^2 + Log[1 + x^2] + x*ArcTan[x]*Log[1 + x^2] - Log[1 + x^2]^2/4

________________________________________________________________________________________

Rubi [A]  time = 0.106084, antiderivative size = 38, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 8, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.889, Rules used = {4846, 260, 5009, 2475, 2390, 2301, 4916, 4884} \[ -\frac{1}{4} \log ^2\left (x^2+1\right )+\log \left (x^2+1\right )+x \log \left (x^2+1\right ) \tan ^{-1}(x)+\tan ^{-1}(x)^2-2 x \tan ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

Int[ArcTan[x]*Log[1 + x^2],x]

[Out]

-2*x*ArcTan[x] + ArcTan[x]^2 + Log[1 + x^2] + x*ArcTan[x]*Log[1 + x^2] - Log[1 + x^2]^2/4

Rule 4846

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*ArcTan[c*x])^p, x] - Dist[b*c*p, Int[
(x*(a + b*ArcTan[c*x])^(p - 1))/(1 + c^2*x^2), x], x] /; FreeQ[{a, b, c}, x] && IGtQ[p, 0]

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 5009

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((d_.) + Log[(f_.) + (g_.)*(x_)^2]*(e_.)), x_Symbol] :> Simp[x*(d + e*L
og[f + g*x^2])*(a + b*ArcTan[c*x]), x] + (-Dist[b*c, Int[(x*(d + e*Log[f + g*x^2]))/(1 + c^2*x^2), x], x] - Di
st[2*e*g, Int[(x^2*(a + b*ArcTan[c*x]))/(f + g*x^2), x], x]) /; FreeQ[{a, b, c, d, e, f, g}, x]

Rule 2475

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))^(q_.)*(x_)^(m_.)*((f_) + (g_.)*(x_)^(s_))^(r_.),
 x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(f + g*x^(s/n))^r*(a + b*Log[c*(d + e*x)^p])^q,
x], x, x^n], x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p, q, r, s}, x] && IntegerQ[r] && IntegerQ[s/n] && Intege
rQ[Simplify[(m + 1)/n]] && (GtQ[(m + 1)/n, 0] || IGtQ[q, 0])

Rule 2390

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_) + (g_.)*(x_))^(q_.), x_Symbol] :> Dist[1/
e, Subst[Int[((f*x)/d)^q*(a + b*Log[c*x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p, q}, x]
 && EqQ[e*f - d*g, 0]

Rule 2301

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 4916

Int[(((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Dist[f^2/
e, Int[(f*x)^(m - 2)*(a + b*ArcTan[c*x])^p, x], x] - Dist[(d*f^2)/e, Int[((f*x)^(m - 2)*(a + b*ArcTan[c*x])^p)
/(d + e*x^2), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && GtQ[p, 0] && GtQ[m, 1]

Rule 4884

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(a + b*ArcTan[c*x])^(p +
 1)/(b*c*d*(p + 1)), x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[e, c^2*d] && NeQ[p, -1]

Rubi steps

\begin{align*} \int \tan ^{-1}(x) \log \left (1+x^2\right ) \, dx &=x \tan ^{-1}(x) \log \left (1+x^2\right )-2 \int \frac{x^2 \tan ^{-1}(x)}{1+x^2} \, dx-\int \frac{x \log \left (1+x^2\right )}{1+x^2} \, dx\\ &=x \tan ^{-1}(x) \log \left (1+x^2\right )-\frac{1}{2} \operatorname{Subst}\left (\int \frac{\log (1+x)}{1+x} \, dx,x,x^2\right )-2 \int \tan ^{-1}(x) \, dx+2 \int \frac{\tan ^{-1}(x)}{1+x^2} \, dx\\ &=-2 x \tan ^{-1}(x)+\tan ^{-1}(x)^2+x \tan ^{-1}(x) \log \left (1+x^2\right )-\frac{1}{2} \operatorname{Subst}\left (\int \frac{\log (x)}{x} \, dx,x,1+x^2\right )+2 \int \frac{x}{1+x^2} \, dx\\ &=-2 x \tan ^{-1}(x)+\tan ^{-1}(x)^2+\log \left (1+x^2\right )+x \tan ^{-1}(x) \log \left (1+x^2\right )-\frac{1}{4} \log ^2\left (1+x^2\right )\\ \end{align*}

Mathematica [A]  time = 0.0083078, size = 38, normalized size = 1. \[ -\frac{1}{4} \log ^2\left (x^2+1\right )+\log \left (x^2+1\right )+x \log \left (x^2+1\right ) \tan ^{-1}(x)+\tan ^{-1}(x)^2-2 x \tan ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

Integrate[ArcTan[x]*Log[1 + x^2],x]

[Out]

-2*x*ArcTan[x] + ArcTan[x]^2 + Log[1 + x^2] + x*ArcTan[x]*Log[1 + x^2] - Log[1 + x^2]^2/4

________________________________________________________________________________________

Maple [C]  time = 0.582, size = 1913, normalized size = 50.3 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In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*csgn(I*(1+I*x)^2/(x^2+1))*csgn(I*(1+I*x)/(x^2+1)^(1/2))^2-1/2*arc
tan(x)*Pi*csgn(I*(1+I*x)^2/(x^2+1))*csgn(I*(1+I*x)^2/(x^2+1)/((1+I*x)^2/(x^2+1)+1)^2)*csgn(I/((1+I*x)^2/(x^2+1
)+1)^2)-2*ln((1+I*x)^2/(x^2+1)+1)-ln((1+I*x)^2/(x^2+1)+1)^2-1/2*arctan(x)*Pi*csgn(I*(1+I*x)^2/(x^2+1))^3-1/2*a
rctan(x)*Pi*csgn(I*(1+I*x)^2/(x^2+1)/((1+I*x)^2/(x^2+1)+1)^2)^3+1/2*arctan(x)*Pi*csgn(I*((1+I*x)^2/(x^2+1)+1)^
2)^3+1/2*arctan(x)*Pi*csgn(I*(1+I*x)^2/(x^2+1)/((1+I*x)^2/(x^2+1)+1)^2)^2*csgn(I/((1+I*x)^2/(x^2+1)+1)^2)+1/2*
arctan(x)*Pi*csgn(I*((1+I*x)^2/(x^2+1)+1))^2*csgn(I*((1+I*x)^2/(x^2+1)+1)^2)-arctan(x)*Pi*csgn(I*((1+I*x)^2/(x
^2+1)+1))*csgn(I*((1+I*x)^2/(x^2+1)+1)^2)^2+2*I*arctan(x)+2*ln(2)*ln((1+I*x)^2/(x^2+1)+1)

________________________________________________________________________________________

Maxima [A]  time = 1.44473, size = 57, normalized size = 1.5 \begin{align*}{\left (x \log \left (x^{2} + 1\right ) - 2 \, x + 2 \, \arctan \left (x\right )\right )} \arctan \left (x\right ) - \arctan \left (x\right )^{2} - \frac{1}{4} \, \log \left (x^{2} + 1\right )^{2} + \log \left (x^{2} + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(arctan(x)*log(x^2+1),x, algorithm="maxima")

[Out]

(x*log(x^2 + 1) - 2*x + 2*arctan(x))*arctan(x) - arctan(x)^2 - 1/4*log(x^2 + 1)^2 + log(x^2 + 1)

________________________________________________________________________________________

Fricas [A]  time = 1.43342, size = 113, normalized size = 2.97 \begin{align*} -2 \, x \arctan \left (x\right ) + \arctan \left (x\right )^{2} +{\left (x \arctan \left (x\right ) + 1\right )} \log \left (x^{2} + 1\right ) - \frac{1}{4} \, \log \left (x^{2} + 1\right )^{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(arctan(x)*log(x^2+1),x, algorithm="fricas")

[Out]

-2*x*arctan(x) + arctan(x)^2 + (x*arctan(x) + 1)*log(x^2 + 1) - 1/4*log(x^2 + 1)^2

________________________________________________________________________________________

Sympy [A]  time = 0.94249, size = 39, normalized size = 1.03 \begin{align*} x \log{\left (x^{2} + 1 \right )} \operatorname{atan}{\left (x \right )} - 2 x \operatorname{atan}{\left (x \right )} - \frac{\log{\left (x^{2} + 1 \right )}^{2}}{4} + \log{\left (x^{2} + 1 \right )} + \operatorname{atan}^{2}{\left (x \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(atan(x)*ln(x**2+1),x)

[Out]

x*log(x**2 + 1)*atan(x) - 2*x*atan(x) - log(x**2 + 1)**2/4 + log(x**2 + 1) + atan(x)**2

________________________________________________________________________________________

Giac [B]  time = 1.09061, size = 124, normalized size = 3.26 \begin{align*} \frac{1}{2} \, \pi x \log \left (x^{2} + 1\right ) \mathrm{sgn}\left (x\right ) - x \arctan \left (\frac{1}{x}\right ) \log \left (x^{2} + 1\right ) - \frac{3}{2} \, \pi ^{2} \mathrm{sgn}\left (x\right ) - \pi x \mathrm{sgn}\left (x\right ) - \pi \arctan \left (\frac{1}{x}\right ) \mathrm{sgn}\left (x\right ) + \frac{1}{2} \, \pi ^{2} + \pi \arctan \left (x\right ) + \pi \arctan \left (\frac{1}{x}\right ) + 2 \, x \arctan \left (\frac{1}{x}\right ) + \arctan \left (\frac{1}{x}\right )^{2} - \frac{1}{4} \, \log \left (x^{2} + 1\right )^{2} + \log \left (x^{2} + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(arctan(x)*log(x^2+1),x, algorithm="giac")

[Out]

1/2*pi*x*log(x^2 + 1)*sgn(x) - x*arctan(1/x)*log(x^2 + 1) - 3/2*pi^2*sgn(x) - pi*x*sgn(x) - pi*arctan(1/x)*sgn
(x) + 1/2*pi^2 + pi*arctan(x) + pi*arctan(1/x) + 2*x*arctan(1/x) + arctan(1/x)^2 - 1/4*log(x^2 + 1)^2 + log(x^
2 + 1)